<template lang="html">
  <div class="registerConsumer">
    <!-- <headerModule></headerModule>
    <consumer></consumer>
    <footerModule></footerModule> -->

      <el-col :xs="24" :sm="{span:20,offset:0}" :md="{span:20,offset:0}" :lg="{span:16,offset:0}" class="consumer-main" >
        <el-col :span="24">
          <el-steps :space="120" :center="true"  :align-center="true" :active="active" >
          <el-step title="基本信息"></el-step>
          <el-step title="单位信息"></el-step>
          <el-step title="资产信息"></el-step>
          <el-step title="银行卡信息"></el-step>
          <el-step title="上传资料"></el-step>

          </el-steps>
        </el-col>
        <el-col :span="14" :offset="5">

            <router-view></router-view>
            <!-- <router-view v-show="ist[1]"></router-view>
            <router-view v-show="ist[2]"></router-view>
            <router-view v-show="ist[3]"></router-view>
            <router-view v-show="ist[4]"></router-view> -->
        </el-col>
        <el-col :span="14" :offset="5">

          <el-button @click="old">上一步</el-button>
          <el-button v-show="!isb" @click="next">下一步</el-button>


            <el-button v-show='isb' @click="ok">完成</el-button><br>
            <span> * 会员权益：
  1.     缴纳会费1万元/年即可成为淘梦者俱乐部会员，并享受30万元消费激励额度。
  2.     消费激励额度用完后可提交书面申请提升额度，是否准予提升额度由淘梦者俱乐部决定。
  3.     投资淘梦者商城推荐理财产品可获取投资额等额的消费额度。
  4.     可获得淘梦者理财商学院学习名额1名。
  5.     会员转介绍新会员可获得5万元/人的消费额度。
  会员权益最终解释权归“淘梦者俱乐部”所有，淘梦者俱乐部有权根据需要制定、
  修改各类具体规则并在淘梦者俱乐部官网公告发布，不再另行向会员做个别通知，
  会员有权选择继续或者停止使用淘梦者俱乐部服务。</span>
        </el-col>


      </el-col>


  </div>


</template>

<script>
// import headerModule from "../../components/header/headerModule.vue"
// import consumer from "./consumer.vue"
// import footerModule from "../../components/footer/footerModule.vue"
export default {
    data() {
        return {
            active: 1,
            isb: false,
            ist: [true, false, false, false, false],
            hrefArr: ["/home/registerConsumer/basic", "/home/registerConsumer/work", "/home/registerConsumer/poperty", "/home/registerConsumer/bank", "/home/registerConsumer/uploading"],
            i: 0

        }
    },
    components: {

    },
    methods: {
        next() {
            if (this.$route.path != this.hrefArr[this.i]) {
                for (let i = 0; i < this.hrefArr.length; i++) {
                    if (this.hrefArr[i] == this.$route.path) {
                        this.i = i
                        this.active = i
                        console.log("判断到当前位置有异常" + this.i);

                    }
                }
            }

            //步骤条 下一步
            this.active++
                if (this.active >= 5) {
                    this.isb = true;
                    this.active = 5



                }

            if (this.i++ >= 4) {
                this.i = 4

            }




            this.$router.push(this.hrefArr[this.i])


        },
        old() {

            //步骤条 上一步
            if (this.active == 5) {
                this.isb = false

            }
            if (this.i-- <= 0) {
                this.i = 0
            }
            if (this.active-- <= 0) {
                this.active = 0

            }

            this.$router.push(this.hrefArr[this.i])
        },
        ok() {
            this.$router.push('/user')
        }
    }
}
</script>

<style lang="css">
.consumer-main{
  height: 900px;
  margin-top: 20px;
  background-color: #fff;

}
</style>
